<?php
namespace App\Http\Controllers\Admin;

trait CallController
{
    /**
     * @param $name
     * @param $arguments
     * @return mixed
     */
    public function __call($name,$arguments)
    {
        try{
            return $this->$name(...$arguments);
        }catch (\Exception $e){
            return $this->fail('ERROR', $e->getMessage());
        }catch (\Error $e){
            return $this->fail('ERROR', $e->getMessage());
        }
    }
}